package com.zdxlz.desensitize.service;

import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONObject;
import com.zdxlz.desensitize.core.IDesensitizeRuleService;

/**
 * @author LySoY
 */
public class SuccessDesensitizeRuleServiceImpl implements IDesensitizeRuleService {

    @Override
    public boolean allowDesensitize(Object obj) {
        JSONObject jsonObject = JSON.parseObject(JSON.toJSONString(obj));
        return jsonObject.containsKey("code") && "200".equals(jsonObject.get("code").toString());
    }
}
